import request from '@/utils/request'

// 查询进货退货列表
export function listInrejected(query) {
  return request({
    url: '/inrejected/inrejected/list',
    method: 'get',
    params: query
  })
}

// 查询进货退货详细
export function getInrejected(prId) {
  return request({
    url: '/inrejected/inrejected/' + prId,
    method: 'get'
  })
}

// 新增进货退货
export function addInrejected(data) {
  return request({
    url: '/inrejected/inrejected',
    method: 'post',
    data: data
  })
}

// 修改进货退货
export function updateInrejected(data) {
  return request({
    url: '/inrejected/inrejected',
    method: 'put',
    data: data
  })
}

// 删除进货退货
export function delInrejected(prId) {
  return request({
    url: '/inrejected/inrejected/' + prId,
    method: 'delete'
  })
}
// 获取编码
export function getCode(code) {
  return request({
    url: '/inrejected/inrejected/getcode?code=' + code,
    method: 'post'
  })
}
//查询进货订单所有商品
export function selectPurchaseRejectProduct(query) {
  return request({
    url: '/inrejected/inrejected/selectPurchaseRejectProduct',
    method: 'post',
    params: query
  })
}
//审核
export function checkbyId(map) {
  return request({
    url: '/inrejected/inrejected/check',
    method: 'post',
    data:map
  })
}
//撤销
export function revokebyId(prId) {
  return request({
    url: '/inrejected/inrejected/revoke?prId='+prId,
    method: 'post',
  })
}
//关闭单据
export function colseById(prId) {
  return request({
    url: '/inrejected/inrejected/colseById?prId='+prId,
    method: 'post',
  })
}
//查看进货订单详情
export function getInfo(prcode) {
  return request({
    url: '/inrejected/inrejected/fileInfo?prcode='+prcode,
    method: 'post',
  })
}

//根据进货单进货退货单累计退货数量
export function selectByCode(phCode) {
  return request({
    url: '/inrejected/inrejected/selectByCode?phCode='+phCode,
    method: 'get',
  })
}
